-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
31 lines (23 loc) · 880 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
double A, B, C, triangulo, circulo, trapezio, quadrado, retangulo;
final double PI = 3.14159;
A = sc.nextDouble();
B = sc.nextDouble();
C = sc.nextDouble();
triangulo = A * C / 2;
circulo = PI * Math.pow(C, 2);
trapezio = (A + B) * C / 2;
quadrado = Math.pow(B, 2);
retangulo = A * B;
System.out.printf("TRIANGULO: %.3f%n", triangulo);
System.out.printf("CIRCULO: %.3f%n", circulo);
System.out.printf("TRAPEZIO: %.3f%n", trapezio);
System.out.printf("QUADRADO: %.3f%n", quadrado);
System.out.printf("RETANGULO: %.3f%n", retangulo);
sc.close();
}
}